﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL.Info;
using BLL.Info.Impl;
using Utils;
public partial class Page_Home : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
         //最新新闻信息top10列表
        showLatestNewsTop10();
        //最新事件信息top10列表
        showLatestEventTop10();
        //最新出版物信息top10列表
        showLatestPublicationTop10();
    }

    //最新新闻信息top10列表
    private void showLatestNewsTop10()
    {
        NewsBO newsBO = new NewsBOImpl();
        gvNewsList.DataSource = newsBO.ShowLatestTopNews(5);
        gvNewsList.DataBind();
    }
    //最新事件信息top10列表
    private void showLatestEventTop10()
    {
        EventBO eventBO = new EventBOImpl();
        gvEventList.DataSource = eventBO.ShowLatestTopEvent(5);
        gvEventList.DataBind();
    }
    //最新出版物信息top10列表
    private void showLatestPublicationTop10()
    {
        PublicationBO publicationBO = new PublicationBOImpl();
        gvPublicationList.DataSource = publicationBO.ShowLatestTopPublication(5);
        gvPublicationList.DataBind();
    }
    //查看更多新闻信息
    protected void lkMoreNews_Click(object sender, EventArgs e)
    {
        Response.Redirect(WebUtil.GetCurrentPath(Request.Url) + "News/NewsList.aspx");
    }
    //查看更多出版物信息
    protected void lkMorePublication_Click(object sender, EventArgs e)
    {
        Response.Redirect(WebUtil.GetCurrentPath(Request.Url) + "Publications/PublicationsList.aspx");
    }
    //查看更多事件信息
    protected void lkMoreEvent_Click(object sender, EventArgs e)
    {
        Response.Redirect(WebUtil.GetCurrentPath(Request.Url) + "Events/EventsList.aspx");
    }
}